const utils = {
  formatEducation (type) {
    let value = ''
    switch (type) {
      case "ED_UNKNNW":
        value = "未知"
        console.log('ttt')
        break
    }
    return value
  },
  formatDate (value) { //格式化时间磋yyyy-mm-dd
    
    let date = new Date(value);
    //注意对方给你的是毫秒还是秒，如果是毫秒需要转秒（*1000）
    let y = date.getFullYear();
    let MM = date.getMonth() + 1;
    MM = MM < 10 ? ('0' + MM) : MM;
    let d = date.getDate();
    d = d < 10 ? ('0' + d) : d;
    let h = date.getHours();
    h = h < 10 ? ('0' + h) : h;
    let m = date.getMinutes();
    m = m < 10 ? ('0' + m) : m;
    let s = date.getSeconds();
    s = s < 10 ? ('0' + s) : s;
    if (!value) {
      return ''
    } else {
      return y + '-' + MM + '-' + d;
    }
  },
  formatDate2 (value) { //格式化时间磋yyyy-mm-dd h:m:s
    let date = new Date(value);
    //注意对方给你的是毫秒还是秒，如果是毫秒需要转秒（*1000）
    let y = date.getFullYear();
    let MM = date.getMonth() + 1;
    MM = MM < 10 ? ('0' + MM) : MM;
    let d = date.getDate();
    d = d < 10 ? ('0' + d) : d;
    let h = date.getHours();
    h = h < 10 ? ('0' + h) : h;
    let m = date.getMinutes();
    m = m < 10 ? ('0' + m) : m;
    let s = date.getSeconds();
    s = s < 10 ? ('0' + s) : s;
    return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
  }
}
export default utils